import 'package:gold/generated/json/base/json_field.dart';
import 'package:gold/generated/json/gold_recover_order_model.g.dart';
import 'dart:convert';

import 'package:gold/model/address_model.dart';
import 'package:gold/model/order_model.dart';
export 'package:gold/generated/json/gold_recover_order_model.g.dart';

@JsonSerializable()
class GoldRecoverOrderModel {
	/// 订单ID
	int? id;
	@JSONField(name: 'user_id')
	/// 用户ID
	int? userId;
	/// 回收方式:online=线上,offline=线下
	String? method;
	/// 类型:1=定价后来料,2=来料后定价
	String? type;
	/// 重量
	double? weight;
	/// 单价
	double? price;
	/// 预估总价
	@JSONField(name: 'total_price')
	double? totalPrice;
	/// 预约门店
	@JSONField(name: 'shop_id')
	int? shopId;
	/// 预约到店时间
	@JSONField(name: 'arrive_time')
	String? arriveTime;
	/// 取件地址ID
	@JSONField(name: 'address_id')
	int? addressId;
	/// 预约取件时间
	@JSONField(name: 'pickup_time')
	String? pickupTime;
	/// 状态:1=待取件,2=待收件,3=待核件,4=待确认,5=已完成
	String? status;
	/// 创建时间
	@JSONField(name: 'created_at')
	String? createdAt;
	/// 更新时间
	@JSONField(name: 'updated_at')
	String? updatedAt;
	/// 发件时间
	@JSONField(name: 'shipment_at')
	String? shipmentAt;
	/// 签收时间
	@JSONField(name: 'receipt_at')
	String? receiptAt;
	/// 核验时间
	@JSONField(name: 'audit_at')
	String? auditAt;
	/// 确认交易时间
	@JSONField(name: 'confirm_at')
	String? confirmAt;
	/// 核验视频
	@JSONField(name: 'audit_video')
	String? auditVideo;
	/// 快递单号
	@JSONField(name: 'express_number')
	String? expressNumber;
	/// 核实重量
	@JSONField(name: 'audit_weight')
	double? auditWeight;
	/// 核实总价
	@JSONField(name: 'audit_total_price')
	double? auditTotalPrice;
	/// 发货快递公司代号
	@JSONField(name: 'express_com')
	String? expressCom;
	/// 发货快递单号
	@JSONField(name: 'express_nu')
	String? expressNu;
	/// 发货物流信息
	ExpressModel? express;
	/// 收货地址
	AddressModel? address;
	/// 退货信息
	RecoverRefundModel? refund;

	GoldRecoverOrderModel();

	factory GoldRecoverOrderModel.fromJson(Map<String, dynamic> json) => $GoldRecoverOrderModelFromJson(json);

	Map<String, dynamic> toJson() => $GoldRecoverOrderModelToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class RecoverRefundModel {
	/// 退款单号
	@JSONField(name: 'refund_no')
	String? refundNo;
	/// 取消类型:0=用户取消,1=平台取消
	String? type;
	/// 退款金额
	String? price;
	/// 退货理由
	String? reason;
	/// 创建时间
	@JSONField(name: 'created_at')
	String? createdAt;
	/// 退货快递公司代号
	@JSONField(name: 'express_com')
	String? expressCom;
	/// 退货快递单号
	@JSONField(name: 'express_nu')
	String? expressNu;
	/// 退货快递物流信息
	@JSONField(name: 'express')
	ExpressModel? express;

	RecoverRefundModel();

	factory RecoverRefundModel.fromJson(Map<String, dynamic> json) => $RecoverRefundModelFromJson(json);

	Map<String, dynamic> toJson() => $RecoverRefundModelToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}